package br.com.almoxarifadoporttek.tools;

import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;

public class CamposBrancosValidator implements Validator
{

	@Override
	public void validate(FacesContext facesContext, UIComponent uIComponent, Object object) throws ValidatorException 
	{			
		if(object == null || object.toString().equalsIgnoreCase(""))
		{
			FacesMessage message = new FacesMessage();
	        message.setDetail("Campo requerido!");
	        message.setSummary("Campo requerido!");
	        message.setSeverity(FacesMessage.SEVERITY_ERROR);
	        throw new ValidatorException(message);
			
		}	
	}

}
